﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CadastroCategoria.aspx.cs" Inherits="SFsoftSite.Cadastros.CadastroCategoria" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h1 style="padding-left:30px">
        Cadastro de Categoria
    </h1>
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
     <ContentTemplate>
        <table align="center">
            <tr>
                <td>
                    Nome da categoria:
                </td>
                <td>
                    <asp:TextBox ID="txtNomeCategoria" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnCadastrar" runat="server" Text="Cadastrar" OnClick="btnCadastrar_Click" />
                </td>
            </tr>
        </table>
        <br />
        <br />
        <table align="center">
            <tr>
                <td>
                    <asp:GridView ID="GridView1" runat="server" DataKeyNames="ID" AutoGenerateColumns="false" AutoGenerateEditButton="false"
        AutoGenerateDeleteButton="false" OnRowEditing="EditRecord" OnRowCancelingEdit="CancelRecord" OnRowUpdating="UpdateRecord"
        OnRowDeleting="DeleteRecord">
            <Columns>
                <asp:CommandField ButtonType="Button" ShowDeleteButton="true" ShowEditButton="true" EditText="Editar" DeleteText="Deletar" UpdateText="Atualizar" CancelText="Cancelar" />
                <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="true" />
                <asp:TemplateField HeaderText="Nome">
                    <ItemTemplate>
                        <%# Eval("Nome")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCategoria" runat="server" Text='<%# Eval("Nome") %>' Columns="50"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>    
                </td>
            </tr>
        </table>
    </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <br />
</asp:Content>
